package com.jolink.omiis.wechat.api.impl;

import org.slf4j.LoggerFactory;

import com.jolink.omiis.wechat.api.IWeChatBrokerMessage;
import com.jolink.omiis.wechat.util.WeChatConfiguration;

/**
 * 
 * @author WangYanqing
 *
 */
public class WeChatBrokerMessage extends WeChatApiBaseService implements IWeChatBrokerMessage {

	private static org.slf4j.Logger logger = LoggerFactory.getLogger(WeChatBrokerMessage.class);

	@Override
	public String response(String responseMessage) {
		long t1 = System.currentTimeMillis();
		logger.info("调用中继消息接口发送回执信息，发送内容：{}。", responseMessage);
		// 转发服务器地址
		String baseUri = WeChatConfiguration.getIngleton().getValue("OMIIS_BROKER_SERVER_URL");
		String result = null;
		result = executePost(baseUri, "", responseMessage);
		long t2 = System.currentTimeMillis();
		logger.info("调用中继消息接口发送回执信息完成，返回结果：{}，耗时：{}毫秒。", result, (t2 - t1));
		return result;
	}
}
